﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Employee/Employee.master" AutoEventWireup="true" CodeBehind="empList.aspx.cs" Inherits="HRdex_Final.Employee.WebForm1" %>
<asp:Content ID="EmpListContent" ContentPlaceHolderID="MainContent" runat="server">
    <asp:GridView ID="gvEmpList" runat="server" AutoGenerateColumns="False" 
    DataKeyNames="#" DataSourceID="EmpList" style="text-align: left">
    <Columns>
        <asp:BoundField DataField="#" HeaderText="#" ReadOnly="True" 
            SortExpression="#" />
        <asp:BoundField DataField="Name" HeaderText="Name" ReadOnly="True" 
            SortExpression="Name" />
        <asp:BoundField DataField="Position" HeaderText="Position" 
            SortExpression="Position" />
        <asp:BoundField DataField="Department" HeaderText="Department" 
            SortExpression="Department" />
        <asp:BoundField DataField="Contact No" HeaderText="Contact No" 
            SortExpression="Contact No" />
        <asp:BoundField DataField="Email" HeaderText="Email" SortExpression="Email" />
    </Columns>
    </asp:GridView>
<asp:SqlDataSource ID="EmpList" runat="server" 
    ConnectionString="<%$ ConnectionStrings:HRmainConnectionString %>" 
    SelectCommand="SELECT formEmployees.EmployeeID AS [#], formEmployees.LastName + ', ' + formEmployees.FirstName + ' ' + formEmployees.MiddleName AS Name, catPositions.catPositionsName AS Position, catDepartment.DepartmentName AS Department, formEmployees.ContactNo AS [Contact No], formEmployees.Email FROM formEmployees INNER JOIN catPositions ON formEmployees.catPositionsID = catPositions.catPositionsID INNER JOIN catDepartment ON formEmployees.DeptID = catDepartment.DeptID">
</asp:SqlDataSource>
</asp:Content>